#!/bin/bash

BOOTSTRAP_DIR=/var/lib/alfresco/bootstrap

if [ $1 == "start" ]; then
  cd $BOOTSTRAP_DIR

  python ping.py 

  if [ -f bootstrap-data/cloud-users.json ]; then
    python bootstrap-users.py bootstrap-data/cloud-users.json && mv bootstrap-data/cloud-users.json bootstrap-data/cloud-users.json.installed
  fi
  for f in `find bootstrap-data/sites -name "*.json"`; do
    python bootstrap-site.py $f && mv $f $f.installed
  done
fi
